package CONTROLADOR;

import java.sql.*;
import javax.swing.JOptionPane;

public class BDconfig {
    
    private Connection con;
    
    public BDconfig(){}
    
    public BDconfig(String bd, String usuario, String pass){
        if(!usuario.equalsIgnoreCase("Admin") || !pass.equalsIgnoreCase("matriculix")){
            JOptionPane.showMessageDialog(null,"usuario y/o contraseña incorrecta(s)");
        }
        else{
            try{
                Class.forName("com.mysql.jdbc.Driver");

                con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/"+bd,usuario,pass);

            }catch(Exception ex){
                JOptionPane.showMessageDialog(null, "Error: "+ex);
            }
        }
    }
    
}
